package com.typhoon.service.impl;



import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.typhoon.dto.UserDto;
import com.typhoon.service.UserService;
import com.typhoon.dubbo_provider.dao.UserDao;
import com.typhoon.entity.User;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;

    @Override
    public UserDto queryByPK(Long id) {
        User user = this.userDao.queryByPK(id);
        if(null == user) {
            return null;
        }
        UserDto dto = new UserDto();
        dto.setId(user.getId());
        dto.setName(user.getName());
        dto.setCreateTime(user.getCreateTime());
        return dto;
    }

    @Override
    public List<UserDto> list(Map<String, Object> params) {
        throw new UnsupportedOperationException("暂不支持此操作");
    }

}